/*
 * Defines.h
 *
 *  Created on: 2010-12-27
 *      Author: stargui
 */

#ifndef DEFINES_H_
#define DEFINES_H_

#define CONFIG_RELEASE_MODE		0

enum enumHardwareDefines
{
	HARDWARE_VIDEO_CHANNEL_NUM = 4,

	HARDWARE_AUDIO_CHANNEL_NUM = 4,

	HARDWARE_ALARM_IN_CHANNEL_NUM = 4,

	HARDWARE_ALARM_OUT_CHANNEL_NUM = 1,

	HARDWARE_STORAGE_DEVICE_NUM = 1,

	MAX_AUTH_SERIAL_LEN = 60,
};

enum enumAvStreamReadyDefines
{
	
	AVSTREAM_VIDEOSTAND_SET = 0x01,
		
	AVSTREAM_MAINSTREAM_ENCODER_START = 0x01<<1,

	AVSTREAM_SUBSTREAM_ENCODER_START = 0x01<<2,

	AVSTREAM_MOBILESTREAM_ENCODER_START = 0x01<<3,

	AVSTREAM_MOTIONDETECT_START = 0x01<<4,

	AVSTREAM_VIDEOMASK_START = 0x01<<5,

	AVSTREAM_OVERLAYNAME_START = 0x01<<6,

	AVSTREAM_OVERLAYTIME_START = 0x01<<7,

	AVSTREAM_VIDEODECODER_START = 0x01<<8,

	AVSTREAM_ALARMDETECT_START = 0x01<<9,

};

enum enumSystemDefines
{
	MAX_VIDEO_FRAME_SIZE = 384 * 1024,

	MAX_AUDIO_FRAME_SIZE = 64 * 1024,

	MAX_PTZ_PRESET_POINT = 64,

	MAX_PTZ_CRUISE_LINE = 16,

	MAX_ONLINE_USER_NUM = 4,

	MAX_USERMANAGEMENT_NUM = 9, //0 super admin

	MAX_USER_NAME_SIZE = 32,

	MAX_USER_PASSWD_SIZE = 32,

	MAX_OSD_NAME_SIZE = 32,

	MAX_DEVICE_NAME_SIZE = 32,

	MAX_SESSION_SIZE = 48,
	MAX_FILE_NAME_SIZE = 128,
};

enum enumShareMemeryParameter
{
	MAIN_STREAM_BUFFER_SIZE = 1024*1024,

	MAIN_STREAM_BUFFER_FRAME_COUNT = 512,


	SUB_STREAM_BUFFER_SIZE = 256*1024,

	SUB_STREAM_BUFFER_FRAME_COUNT = 256,


	MOBILE_STREAM_BUFFER_SIZE = 256*1024,

	MOBILE_STREAM_BUFFER_FRAME_COUNT = 256,


	TALK_STREAM_BUFFER_SIZE = 128 * 1024,

	TALK_STREAM_FRAME_COUNT = 256,


	SNAP_STREAM_BUFFER_SIZE = 256*1024,

	SNAP_STREAM_BUFFER_FRAME_COUNT = 20,


	MSSP_STREAM_BUFFER_SIZE = 384*1024,

	MSSP_STREAM_BUFFER_FRAME_COUNT = 50,

	UPGRADE_HEAD_BUFFER_SIZE			= 1024,

	PERIOD_BACK_BUFFER_SIZE = 700*1024, /**< 流段备份缓冲区 */

	PERIOD_BACK_BUFFER_FRAME_COUNT = 10, /**< 每包数据<=64K */


	UPGRADE_BUFFER_SIZE = 10* 2048 + 512, /**< 升级的共享内存大小 */

	UPGRADE_BUFFER_FRAME_COUNT = 10, /**< 需要保证每包数据<=2k */
};
//主码流共享内存名称
#define MAIN_STREAM_BUFFER_NAME "MainStream-chn%02d"
//子码流共享内存名称
#define SUB_STREAM_BUFFER_NAME "SubStream-chn%02d"
//手机码流共享内存名称
#define MOBILE_STREAM_BUFFER_NAME "MobStream-chn%02d"
//对讲设备编码的音频流
#define TALK_STREAM_GETBUFFER_NAME "TalkGetStream"
//对奖PC上传来的音频流
#define TALK_STREAM_SETBUFFER_NAME "TalkSetStream"
//抓拍图片的共享内存名称
#define SNAP_STREAM_BUFFER_NAME "SnapStream"


enum enumSystemAlarmType{
	ALARM_TYPE_NO = 0x00, /**< 无报警，录像时，此为常规录像 */
	ALARM_TYPE_IO = 0x01, /**< IO报警 */
	ALARM_TYPE_MD = 0x02, /**< 移动侦测 */
	ALARM_TYPE_VS = 0x03, /**< 视频遮挡 */
	ALARM_TYPE_VL = 0x04, /**< 视频丢失 */
	ALARM_TYPE_HDDFULL = 0x05, /**< 硬盘满 */
	ALARM_TYPE_NOHDD = 0x06, /**< 无硬盘 */
	ALARM_TYPE_HDDUNFORMAT = 0x07, /**< 硬盘未格式化 */
	ALARM_TYPE_HDDERROR = 0x08, /**< 硬盘读写出错 */
	ALARM_TYPE_IPCONFLICT = 0x09, /**< IP地址冲突 */
};

enum enumSnapReson{
	SNAP_RESON_MANUAL = 0,
	SNAP_RESON_TIMER,
	SNAP_RESON_IO,
	SNAP_RESON_MD,
	SNAP_RESON_VS,
	SNAP_RESON_VL,
	SNAP_RESON_HDDERR,
	SNAP_RESON_IPCONFLICT
};

enum enumStreamType{
	STREAM_TYPE_SUB = 0,
	STREAM_TYPE_MAIN = 1,
	STREAM_TYPE_MOBILE = 2
};

enum eHDD_ALARM_TYPE{
	HDD_ALARM_TYPE_NOHDD,
	HDD_ALARM_TYPE_HDDFULL,
	HDD_ALARM_TYPE_HDDUNFORMAT,
	HDD_ALARM_TYPE_HDDERROR,
	HDD_ALARM_TYPE_MAX
};

#define MAX_GROUPID  4

#endif /* DEFINES_H_ */


